class excep{
public static void validate(int age)throws InvalidAgeException{
if(age<18)
{
throw new InvalidAgeException("not valid");                                     
System.out.println("vote");
}
}
public static void main(String[] fe)
{
try{
validate(13);
}
catch(Exception e){
System.out.println("Exception occured:"+e);
}
}
}


